<?php
$data=[];
$data['result']=0;
$data['msg']=nl2br(htmlentities($message));
$data['code']=$code;
\think\Log::write($data['msg'].'|'.json_encode(input()),'exception');
$input=\app\common\model\Input::getAll();
//$input=input();
$debug=isset($input['echo'])?$input['echo']:'';
if($debug==1){
   $data['INPUT']=$input;
}
if(defined('SDK_1')){
    $str=json_encode($data,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
    //echo $str;
    if($debug==1){
        echo $str;
    }else{
        echo myEncryption($data);
    }

}else{
    echo json_encode($data,JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE);
}
function myEncryption($data){
        $str1 = json_encode($data);
        $str2 = base64_encode($str1);
        $str3 = str_replace("=","|",$str2);
        $n1 = rand(1,9);
        $n1str = '';
        for($i=0;$i<$n1;$i++){$n1str .= rand(1,9);}
        $str4 = $n1str.$str3.$n1;
        $str5 = base64_encode($str4);
        $str6 = str_replace("=","|",$str5);
        $n2 = rand(1,9);
        $n2str = '';
        for($i=0;$i<$n2;$i++){$n2str .= rand(1,9);}
        $str7 = $n2.$str6.$n2str;
        return $str7;
    }
function myDecryption($data){
        $n1 = substr($data,0,1);
        $str1 = substr($data,1,-$n1);
        $str2 = str_replace("|","=",$str1);
        $str3 = base64_decode($str2);
        $n2 = substr($str3,-1);
        $str4 = substr($str3,$n2,-1);
        $str5 = base64_decode($str4);
        $json_str = str_replace("|","=",$str5);
        return $json_str;
    }
?>